<?php

namespace app\api\validate\user;

use app\api\validate\Validates;

class Address extends Validates
{
    /**
     * 定义验证规则
     * 格式：'字段名'	=>	['规则1','规则2'...]
     *
     * @var array
     */	
	protected $rule = [
	    'area|区域' => 'require|max:80',
        'username|收件人姓名' => 'require|chsAlpha|length:1,10',
        'mobile|手机号码' => 'require|mobile',
        'address|详细地址' => 'require|max:80',
        'default|是否默认' => 'require|in:0,1'
    ];
    
    /**
     * 定义错误信息
     * 格式：'字段名.规则名'	=>	'错误信息'
     *
     * @var array
     */	
    protected $message = [];

    /**
     * 场景验证
     * @var []
     */
    protected $scene = [
        'create' => ['mobile','area','username','address','default'],
        'update' => ['mobile','area','username','address','default']
    ];

}
